/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ch.ffhs.perellano.volunteers;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author perellano
 */
@Entity
@Table(name = "STELLENINSERAT")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Stelleninserat.findAll", query = "SELECT s FROM Stelleninserat s"),
    @NamedQuery(name = "Stelleninserat.findById", query = "SELECT s FROM Stelleninserat s WHERE s.id = :id"),
    @NamedQuery(name = "Stelleninserat.findByName", query = "SELECT s FROM Stelleninserat s WHERE s.name = :name"),
    @NamedQuery(name = "Stelleninserat.findByHomepageurl", query = "SELECT s FROM Stelleninserat s WHERE s.homepageurl = :homepageurl"),
    @NamedQuery(name = "Stelleninserat.findByTitel", query = "SELECT s FROM Stelleninserat s WHERE s.titel = :titel"),
    @NamedQuery(name = "Stelleninserat.findByPlz", query = "SELECT s FROM Stelleninserat s WHERE s.plz = :plz"),
    @NamedQuery(name = "Stelleninserat.findByOrt", query = "SELECT s FROM Stelleninserat s WHERE s.ort = :ort")})
public class Stelleninserat implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID")
    private Integer id;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "NAME")
    private String name;
    @Size(max = 255)
    @Column(name = "HOMEPAGEURL")
    private String homepageurl;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "TITEL")
    private String titel;
    @Size(max = 10)
    @Column(name = "PLZ")
    private String plz;
    @Size(max = 50)
    @Column(name = "ORT")
    private String ort;

    public Stelleninserat() {
    }

    public Stelleninserat(Integer id) {
        this.id = id;
    }

    public Stelleninserat(Integer id, String name, String titel) {
        this.id = id;
        this.name = name;
        this.titel = titel;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getHomepageurl() {
        return homepageurl;
    }

    public void setHomepageurl(String homepageurl) {
        this.homepageurl = homepageurl;
    }

    public String getTitel() {
        return titel;
    }

    public void setTitel(String titel) {
        this.titel = titel;
    }

    public String getPlz() {
        return plz;
    }

    public void setPlz(String plz) {
        this.plz = plz;
    }

    public String getOrt() {
        return ort;
    }

    public void setOrt(String ort) {
        this.ort = ort;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Stelleninserat)) {
            return false;
        }
        Stelleninserat other = (Stelleninserat) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ch.ffhs.perellano.volunteers.Stelleninserat[ id=" + id + " ]";
    }
    
}
